-
Notifications
You must be signed in to change notification settings - Fork 0
/
Year 58 - Good Neighbors
154 lines (153 loc) · 2.15 KB
/
Year 58 - Good Neighbors
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
-- 7 Billion Humans (2214M) --
-- 58: Good Neighbors by @commonnickname --
mem1 = nearest datacube
mem2 = nearest worker
jump a
mem3 = foreachdir se:
mem4 = foreachdir n:
a:
if mem1 == 5 and
mem3 == nothing:
mem3 = nearest worker
step mem1
mem4 = nearest worker
jump b
mem1 = foreachdir s:
mem2 = foreachdir w:
b:
jump c
endfor
endfor
c:
if mem1 == 8 and
mem2 == 5:
if mem3 == mem4:
step mem1
pickup s
else:
step mem1
pickup sw
endif
else:
jump d
mem4 = foreachdir n:
d:
if mem1 == 5:
if mem4 == 3:
if mem2 == nothing:
step e
pickup e
else:
step w
pickup w
endif
else:
if mem2 == nothing:
pickup ne
else:
pickup nw
endif
endif
else:
if mem1 == 8:
step e
pickup se
else:
pickup n
endif
endif
endfor
endif
mem1 = calc 0 / 0
else:
if mem2 == mem3 and
mem1 == 3:
step sw
step s
step w
pickup sw
mem1 = calc 0 / 0
endif
jump e
endif
endfor
endfor
e:
if mem1 == 5:
jump f
mem4 = foreachdir nw:
f:
if mem4 == worker:
else:
if mem3 == wall:
step mem1
pickup nw
else:
step ne
step n
pickup ne
endif
endif
endfor
else:
jump g
mem1 = foreachdir s:
mem2 = foreachdir nw:
mem3 = foreachdir sw:
mem4 = foreachdir n:
g:
jump h
endfor
endfor
endfor
endfor
h:
if mem2 == nothing and
mem3 == nothing and
mem4 == nothing:
jump i
mem4 = foreachdir ne:
i:
if mem1 == worker or
mem4 == worker:
if mem1 == worker:
step ne
step e
pickup ne
else:
step se
step e
pickup se
endif
else:
step nw
mem1 = nearest datacube
if mem1 == 5:
step w
else:
step n
endif
pickup nw
endif
endfor
else:
if mem2 == worker:
if mem3 == datacube:
step w
step s
pickup sw
else:
step ne
step ne
pickup ne
endif
else:
if mem4 == worker:
step ne
step e
pickup ne
endif
endif
endif
endif
mem1 = calc 0 / 0